import { Column, Entity, Index } from "typeorm";

@Index("idx_table_data_id", ["tableName", "tableDataId"], {})
@Entity("sys_comment", { schema: "workflow" })
export class SysComment {
    @Column("char", { primary: true, name: "id", length: 36 })
    id: string;

    @Column("varchar", { name: "table_name", comment: "表名", length: 50 })
    tableName: string;

    @Column("char", { name: "table_data_id", comment: "数据id", length: 36 })
    tableDataId: string;

    @Column("char", { name: "from_user_id", comment: "来源用户id", length: 36 })
    fromUserId: string;

    @Column("char", {
        name: "to_user_id",
        nullable: true,
        comment: " 接受用户id",
        length: 36,
    })
    toUserId: string | null;

    @Column("char", {
        name: "comment_id",
        nullable: true,
        comment: "评论id",
        length: 36,
    })
    commentId: string | null;

    @Column("varchar", {
        name: "comment_content",
        nullable: true,
        comment: "回复内容",
        length: 255,
    })
    commentContent: string | null;

    @Column("varchar", {
        name: "create_by",
        nullable: true,
        comment: "创建人",
        length: 50,
    })
    createBy: string | null;

    @Column("datetime", {
        name: "create_time",
        nullable: true,
        comment: "创建日期",
    })
    createTime: Date | null;

    @Column("varchar", {
        name: "update_by",
        nullable: true,
        comment: "更新人",
        length: 50,
    })
    updateBy: string | null;

    @Column("datetime", {
        name: "update_time",
        nullable: true,
        comment: "更新日期",
    })
    updateTime: Date | null;
}
